import { createStore, combineReducers, applyMiddleware, compose } from 'redux'
import logger from 'redux-logger'
import thunk from 'redux-thunk'


import app from './modules/app'
import user from './modules/user'


//合并后的总reducer    reducer/combineReducers是管理员的意思，修改状态需要通过管理员
const reducer = combineReducers({
    app,
    user
})

//创建仓库需要有个管理
const store = createStore(reducer, compose(applyMiddleware(logger), applyMiddleware(thunk)))
// console.log('store', store);
// console.log('store中的状态', store.getState());

export default store;